<template>
    <div class="scan-box">

        <div class="code-box">
            <h3>限时免费领取</h3>
            <div id="qrcode"></div>
            <p>微信扫码，立即挪车</p>
         
        </div>  
        <div class="buy-box">
            <button class="buy-btn" @click="login">马上关注领取</button>
        </div>
    </div>
</template>
<script>
import QRCode from 'qrcodejs2'
export default {
    mounted () {
        this.qrcode();
    },
    methods: {
        login(){
            this.$router.replace("/login");
        },
        qrcode() {
            let qrcode = new QRCode('qrcode', {
                width: 200,  
                height: 200,
                text: 'http://ncm.hjieli.com/nc/#/login', // 二维码地址
            })
        },
    }
}
</script>
<style scoped>
.scan-box{
    
    max-width: 500px;
    margin: 0 auto;
    position: fixed;
    top: 0px;
    bottom: 0px;
    left: 0px;
    right: 0px;
    /* background-color: #5868d4; */
    background-image: url('../assets/share-bg.png');
    background-repeat: no-repeat;
    background-size: 100%;

}
.code-box{
    width: 300px;
    height: 55%;
    position: absolute;
    left: 50%;
    bottom: 15%;
    margin-left: -150px;
    background-color: white;
    border-radius: 10px;
    padding-bottom: 20px;
}
.code-box h3{
    text-align: center;
    letter-spacing: 5px;
    line-height: 45px;
}
#qrcode{
    margin: 0 auto;
    text-align: center;
    width: 200px;
}

.buy-box{
    position: absolute;
    bottom: 24px;
    left: 0px;
    right: 0px;
    /* border: 1px solid red; */
}
.buy-box img{
    max-width: 80%;
}

.buy-box .buy-btn{
    font-size: 18px;
    line-height: 45px;
    padding: 0px 32px ;
    color: white;
    background-color: #7485f5;
    border: none;
    outline: none;
    border-radius: 20px;
    box-shadow: 2px 2px 5px 2px #5868d4;
    margin-top:8px;
    letter-spacing: 5px;
    font-weight: bold;
}
</style>